<template>
    <div class="app-container form-wrapper">
        <el-iframe v-if="urlPath" :url-path="urlPath"/>
    </div>
</template>

<script>
import iframe from '@/components/iframe'
import { getIframeUrl } from '@/api/api'
export default {
    name: 'iframe123',
    components: {
        elIframe: iframe
    },
    data() {
        return {
            formId: '6720',
            urlPath: this.jQueryAPIUrl + '/myehr/form/toForm.action?formId=6664'
        }
    },
    created() {
        // this._getIframeUrl()
        console.log(this.urlPath)
    },
    methods: {
        _getIframeUrl() {
            getIframeUrl(this.formId)
                .then(res => {
                    console.log(res)
                    const query = this.$route.query
                    let temp = ''
                    for (const key in query) {
                        if (query.hasOwnProperty(key)) {
                            temp += `&${key}=${query[key]}`
                        }
                    }
                    this.urlPath = res.url + temp
                })
        }
    }
}
</script>
